namespace FreeDAM.Domain.Migrations
{
    using System.Data.Entity.Migrations;
    
    public partial class ImplementedTagCategory : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "TagCategories",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(nullable: false),
                        Description = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            AddColumn("Tags", "TagCategory_Id", c => c.Int());
            AddForeignKey("Tags", "TagCategory_Id", "TagCategories", "Id");
            CreateIndex("Tags", "TagCategory_Id");
        }
        
        public override void Down()
        {
            DropIndex("Tags", new[] { "TagCategory_Id" });
            DropForeignKey("Tags", "TagCategory_Id", "TagCategories");
            DropColumn("Tags", "TagCategory_Id");
            DropTable("TagCategories");
        }
    }
}
